{extend name="public/base" /}
{block name="body"}
<div class="layui-fluid">
    <div class="layui-row">
        <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
			<div class="widget-head">
				<div class="widget-title a m-cf">系统设置</div>
			</div>
			<div class="widget-body layui-col-sm12 layui-col-md12 layui-col-lg12">
				<div class="layui-tab" lay-filter="group">
					<ul class="layui-tab-title">
  						{foreach name="group" item="value" key="key"}
    					<li {if $key eq 1}class="layui-this"{/if} lay-id="{$key}">{$value}</li>
  						{/foreach}    			
  					</ul>
  					<div class="layui-tab-content">
  						{foreach name="group" item="item" key="key"}
          				<div class="layui-tab-item {if $key eq 1}layui-show{/if}">
            				<form action="{:url('config/save')}" class="layui-form" method="post">
              					{foreach name="list[$key]" item="config"}
              					<div class="layui-form-item">
                					<label class="layui-form-label">{$config.title}</label>
                					<div class="layui-input-block">
                  						{switch name="config.type"}
                    						{case value="input"}
                    							<input type="text" name="{$config.name}" value="{$config.value}" placeholder="请输入{$config.title}" class="layui-input">
                    						{/case}
                    						{case value="textarea"}
                    							<textarea name="{$config.name}" class="layui-textarea" placeholder="请输入{$config.title}">{$config.value}</textarea>
                    						{/case}
                    						{case value="select"}
                    							<select name="{$config.name}">
                      								{volist name=":parse_attr($config.extra)" id="v" key="k"}
                      								<option value="{$k}" >{$v}</option>
                      								{/volist}
                    							</select>
                    						{/case}
                    						{case value="radio"}
                      							{volist name=":parse_attr($config.extra)" id="v" key="k"}
                      							<input type="radio" name="{$config.name}" value="{$k}" title="{$v}" >
                      							{/volist}
                    						{/case}
                    						{case value="image"}
                    							<input type="text" name="{$config.name}" value="{$config.value|default=''}" placeholder="请上传{$config.title}" class="layui-input">
                    							<button type="button" class="layui-btn layui-btn-primary layui-btn-position ajax-images"><i class="fa fa-file-image-o"></i> 选择图片</button>
                    						{/case}
                    						{default /}
                  						{/switch}
                					</div>
              					</div>
              					{/foreach}
              					<div class="layui-form-item">
                					<div class="layui-input-block">
                  						<button class="layui-btn" lay-filter="i" lay-submit="">保存</button>
                  						<button class="layui-btn layui-btn-primary" type="reset">重置</button>
                					</div>
              					</div> 
            				</form>
          				</div>
          				{/foreach}  
  					</div>
				</div>
			</div>
		</div>
	</div>
</div>
{/block}